package middlewares

import (
	"github.com/gin-gonic/gin"
)

// 登陆验证中间件
func MustLogin(c *gin.Context) {
	if c.GetUint("uid") == 0 {
		c.JSON(401, gin.H{
			"flag": false,
			"msg":  "token无效",
		})
		c.Abort()
	}
}
